package br.com.rhinovet.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringUtil {
	
	private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
	
	public static boolean textoPreenchido(String texto) {
		if (texto != null && texto.length() > 0) {
			return true;
		} else {
			return false;
		}
	}
	
	public static boolean validaEmail(String email) {
	    Pattern verificacao = Pattern.compile(EMAIL_PATTERN);  
	    Matcher combinacao = verificacao.matcher(email);  
	    boolean matchFound = combinacao.matches();  
	  
	    return matchFound;
	}
	
}
